function getReflectStd(ageOfMonth, reflectScore) {
    var res = {};

    $.each(standard, function (idx, val) {
        if (ageOfMonth >= val.age_min && ageOfMonth <= val.age_max) {
            if (val.reflect_min == -1 && val.reflect_max == -1) {
                return;
            }
            if (reflectScore >= val.reflect_min || val.reflect_min == -1) {
                if (reflectScore <= val.reflect_max || val.reflect_max == -1) {
                    res.standard_score = val.standard_score;
                    res.percent = val.percent;
                    return false;
                }
            }
        } else {
            return;
        }

    });

    return res;
}
function getPoseStd(ageOfMonth, poseScore) {
    var res = {};
    $.each(standard, function (idx, val) {
        if (ageOfMonth >= val.age_min && ageOfMonth <= val.age_max) {
            if (val.pose_min == -1 && val.pose_max == -1) {
                return;
            }
            if (poseScore >= val.pose_min || val.pose_min == -1) {
                if (poseScore <= val.pose_max || val.pose_max == -1) {
                    res.standard_score = val.standard_score;
                    res.percent = val.percent;
                    return false;
                }
            }
        } else {
            return;
        }

    });

    return res;
}
function getMoveStd(ageOfMonth, moveScore) {
    var res = {};

    $.each(standard, function (idx, val) {
        if (ageOfMonth >= val.age_min && ageOfMonth <= val.age_max) {
            if (val.move_min == -1 && val.move_max == -1) {
                return;
            }
            if (moveScore >= val.move_min || val.move_min == -1) {
                if (moveScore <= val.move_max || val.move_max == -1) {
                    res.standard_score = val.standard_score;
                    res.percent = val.percent;
                    return false;
                }
            }
        } else {
            return;
        }

    });

    return res;
}
function getCatchStd(ageOfMonth, catchScore) {
    var res = {};

    $.each(standard, function (idx, val) {
        if (ageOfMonth >= val.age_min && ageOfMonth <= val.age_max) {
            if (val.catch_min == -1 && val.catch_max == -1) {
                return;
            }
            if (catchScore >= val.catch_min || val.catch_min == -1) {
                if (catchScore <= val.catch_max || val.catch_max == -1) {
                    res.standard_score = val.standard_score;
                    res.percent = val.percent;
                    return false;
                }
            }
        } else {
            return;
        }

    });

    return res;
}
function getVersionStd(ageOfMonth, versionScore) {
    var res = {};
    $.each(standard, function (idx, val) {
        if (ageOfMonth >= val.age_min && ageOfMonth <= val.age_max) {
            if (val.version_min == -1 && val.version_max == -1) {
                return;
            }
            if (versionScore >= val.version_min || val.version_min == -1) {
                if (versionScore <= val.version_max || val.version_max == -1) {
                    res.standard_score = val.standard_score;
                    res.percent = val.percent;
                    return false;
                }
            }
        } else {
            return;
        }

    });

    return res;
}

function getReflectAge(ageOfMonth, reflectScore) {
    var res = {};
    res.age = "-";

    $.each(ageData, function (idx, val) {
        //当月龄大于12时，跳过反射值部分
        if(ageOfMonth > 11 && idx < 11) {
            return;
        }
        if(val.reflect_min == -1 && val.reflect_max == -1) {
            return;
        }
        if(reflectScore >= val.reflect_min || val.reflect_min == -1 ) {
            if(reflectScore <= val.reflect_max || val.reflect_max == -1 ){
                res.age = val.age;
                return false;
            }
        }
    });
    return res;
}

function getPoseAge(poseScore) {
    var res = {};
    res.age = "-";
    $.each(ageData, function (idx, val) {
        if(val.pose_min == -1 && val.pose_max == -1) {
            return;
        }
        if(poseScore >= val.pose_min || val.pose_min == -1 ) {
            if(poseScore <= val.pose_max || val.pose_max == -1 ){
                res.age = val.age;
                return false;
            }
        }
    });
    return res;
}

function getMoveAge(moveScore) {
    var res = {};
    res.age = "-";
    $.each(ageData, function (idx, val) {
        if(val.move_min == -1 && val.move_max == -1) {
            return;
        }
        if(moveScore >= val.move_min || val.move_min == -1 ) {
            if(moveScore <= val.move_max || val.move_max == -1 ){
                res.age = val.age;
                return false;
            }
        }
    });
    return res;
}

function getCatchAge(catchScore) {
    var res = {};
    res.age = "-";
    $.each(ageData, function (idx, val) {
        if(val.catch_min == -1 && val.catch_max == -1) {
            return;
        }
        if(catchScore >= val.catch_min || val.catch_min == -1 ) {
            if(catchScore <= val.catch_max || val.catch_max == -1 ){
                res.age = val.age;
                return false;
            }
        }
    });
    return res;
}

function getVersionAge(versionScore) {
    var res = {};
    res.age = "-";
    $.each(ageData, function (idx, val) {
        if(val.version_min == -1 && val.version_max == -1) {
            return;
        }
        if(versionScore >= val.version_min || val.version_min == -1 ) {
            if(versionScore <= val.version_max || val.version_max == -1 ){
                res.age = val.age;
                return false;
            }
        }
    });
    return res;
}


function getTMQ(reflectScore, poseScore, moveScore, catchScore, versionScore) {
    var res = {};
    var s = reflectScore + poseScore + moveScore + catchScore + versionScore;
    $.each(shang, function (idx, val) {
        if (s >= val.tmq && val.tmq != -1) {
            res.shang = val.shang;
            res.percent = val.percent;
            return false;
        }
    });

    return res;
}

function getFMQ(catchScore, versionScore) {
    var res = {};
    var s = catchScore + versionScore;
    $.each(shang, function (idx, val) {
        if (s >= val.fmq && val.fmq != -1) {
            res.shang = val.shang;
            res.percent = val.percent;
            return false;
        }
    });

    return res;
}

function getGMQ(reflectScore, poseScore, moveScore) {
    var res = {};
    var s = reflectScore + poseScore + moveScore;
    $.each(shang, function (idx, val) {
        if (s >= val.gmq && val.gmq != -1) {
            res.shang = val.shang;
            res.percent = val.percent;
            return false;
        }
    });

    return res;
}